/*
 * Copyright 2009 BioTeam Inc
 * 
 * Licensed under License GNU LESSER GENERAL PUBLIC LICENSE version 3.0 (the "License"); you may not
 * use this file except in compliance with the License. You may obtain a copy of
 * the License at
 * 
 * http://www.gnu.org/copyleft/lesser.html
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and limitations under
 * the License.
 */
package net.bioteam.appweb.submit;


public interface CommandSubmitter {
	
	public static final String FINISH_MARK = ".finishmark";
	public static final String SCRIPT_FILE = "job_script.sh";
	public static final String POST_SCRIPT_FILE = "postjob_script.sh";
	public static final String SUBMIT_SOURCE = "_submitSource";
	public static final String SERVICE_ID = "_serviceID";

	public static final String PROP_NAME = ".props";
	public static final String PRE_COMMAND = "_precommand";
	public static final String GENERATOR = "_generator";
	public static final String BULK_JOB = "_bulk";
	public static final String BULK_NUM = "_bulk_num";
	public static final String MPIPREFIX="_MPIPREFIX";
	
	public static final String TASK_ID = "_task_id";
	/**
	 * prepare the work directory,
	 * copy over the needed input file.
	 * 
	 * @param data information for the implementation to submit the command to underlying system
	 * @throws Exception
	 */
	public UnfinishedJob saveJobInfo(SubmitData data) throws Exception;
    /**
     *
     * @param data information for the implementation to submit the command to underlying system
     * @return a RunStatus which can be used later to retrieve job information.
     * @throws Exception
     */
    public UnfinishedJob submitCommand(UnfinishedJob job) throws Exception;
    
    
    /**
     * 
     * @param job
     * @return whether the job can submitted righ now or not.
     * @throws Exception
     */
    public boolean canSubmit(UnfinishedJob job) throws Exception;
    
    
    public void killJob(RunStatus rs) throws Exception;
    
    
}
